#import "OasisBinaryController.h"
        
#import "OasisBinaryModel.h"
#import "OasisBinaryCell.h"
#import "Masonry.h"

@interface OasisBinaryController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *libertyTableView;
@property (nonatomic, strong) NSMutableArray *yarnModels;

@end

@implementation OasisBinaryController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self pioneerConfigsview];
	[self flexibilityLullabyfetchData];
}


//: 懒加载数据模型数组
- (NSMutableArray *)yarnModels {
	if (!_yarnModels) {
		_yarnModels = [NSMutableArray array];
	}
	return _yarnModels;
}

//: 初始化页面UI
- (void)pioneerConfigsview {

	[self.view addSubview:self.libertyTableView];
	[self.libertyTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


//: 获取数据模型
- (void)flexibilityLullabyfetchData {
	
}

- (UITableView *)figHandleTableView {
    if (!_libertyTableView) {
        _libertyTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _libertyTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _libertyTableView.estimatedRowHeight = 0;
        _libertyTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _libertyTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _libertyTableView.delegate = self;
        _libertyTableView.dataSource = self;
        _libertyTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _libertyTableView.showsVerticalScrollIndicator = NO;
        _libertyTableView.showsHorizontalScrollIndicator = NO;
        _libertyTableView.backgroundColor = UIColor.clearColor;
    }
    return _libertyTableView;
}

#pragma mark - UITableView DataSource 
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.yarnModels.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    OasisBinaryCell *plumeInstinct = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([OasisBinaryCell class])];
    if (plumeInstinct == nil) {
        plumeInstinct = [[OasisBinaryCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([OasisBinaryCell class])];
    }
    plumeInstinct.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return plumeInstinct;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
